extends NodeState

@export var player: Player



func _on_enter() -> void:
	player.animationPlayer.play(Player.ANIMATION_SHOOT)
	player.shoot_gun()
	consuming_bullet()



func consuming_bullet():
	player.current_bullet_number -= 1
	if player.current_bullet_number < 0:
		player.current_bullet_number = 0


func on_shoot_animation_finished():
	if player.inputManager.is_movement_input():
		transition_state(Player.STATE_WALK)
	elif player.inputManager.is_jump_input():
		transition_state(Player.STATE_TAKEOFF)
	else:
		transition_state(Player.STATE_IDLE)
